<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta content="text/html;charset=UTF-8"/>
    <title>Title</title>
    <script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.js"></script>
</head>
<body>
<div>
    <input type="text" name="username" id="username"/><br></br>
    <input type="password" name="pwd" id="pwd"/><br></br>
    <input type="button" name="submit" id="submit" value="登录"/>
</div>
<script type="application/javascript">
    $("#submit").on("click",function () {
        var name=$("#username").val();
        var pwd=$("#pwd").val();
        var url ="login";
        $.post(url,{"username":name,"password":pwd},function (msg) {
            console.log(msg);
        })
    })
</script>
</body>
</html>